﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FundRaising.DAL._FR_DSTableAdapters;
using FundRaising.DAL;

namespace FundRaising.BLL
{
    public class AssoDomainBLL
    {
         public static string Asso;
         public static string Domain;

        private AssoDomainTableAdapter info = null;
        public AssoDomainTableAdapter adapter
        {
            get
            {
                if (info == null) info = new AssoDomainTableAdapter();
                return info;
            }
        }

        public DAL._FR_DS.AssoDomainDataTable getdomainbyothers(string AssoName, string ProjectName, string SubProj)
        {
            return adapter.GetDomainbyothers(AssoName, ProjectName, SubProj);
        }
        public DAL._FR_DS.AssoDomainDataTable GetData()
        {
            return adapter.GetData();
        }
       
        
        
        public DAL._FR_DS.AssoDomainDataTable GetDataByAsso(string AssoName)
        {
            //AssoName = this.Asso;
            return adapter.GetDataBYaSSO(AssoName);
        }

        
        public void DeleteAssoDom(string DomainName, string AssoName, string ProjectName, string SubProj, Guid Original_SerialNum)
        {
            adapter.DeleteAssoDomain(Original_SerialNum);
        }



        public void InsertDefualt(string DomainName, string AssoName)
        {
            DomainName = Domain;
            adapter.InsertDefualtDomainFund(DomainName, AssoName);
        }


        public void Insert(string SerialNum, string DomainName, string AssoName, string ProjectName, string SubProj)
        {
            AssoName = FundRaising.BLL.AssoDomainBLL.Asso;
            DomainName = FundRaising.BLL.AssoDomainBLL.Domain;
            adapter.InsertAssoDomain(DomainName, AssoName, ProjectName, SubProj);
        }

        public void Update(string DomainName, string AssoName, string ProjectName, string SubProj, Guid Original_SerialNum)
        {
           
            AssoName = FundRaising.BLL.AssoDomainBLL.Asso;
            adapter.UpdateAssoDomain(DomainName, AssoName, ProjectName, SubProj, Original_SerialNum);
        }

        public DAL._FR_DS.AssoDomainDataTable GetSubProject(string ProjectName)
        {
            return adapter.GetSubProjByProj(ProjectName);
        }

    }
}
